package com.jiinfo.model;

import java.util.List;

import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;
import com.jfinal.plugin.activerecord.Record;

public class UserRole extends Model<UserRole>{

	private static final long serialVersionUID = 5096281530115263761L;
	public static final UserRole dao = new UserRole();
	
	public void deleteUserRoleByUserId(String userId){
		String sql="delete from t_user_role where userId=?";
		Db.update(sql,userId);
	}
	
	
	public void deleteUserRoleByRoleId(String roleId){
		String sql="delete from t_user_role where roleId=?";
		Db.update(sql,roleId);
	}
	
	public List<Record> getUserRoleByUserId(String userId){
		String sql="select *from t_user_role t where t.removed='0' and userId=?";
		return Db.find(sql,userId);
	}
}
